package com.bskj.kuaifu.service;

import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.bskj.common.bean.model.CodeValue;
import com.bskj.common.bean.model.PayInfo;
import com.bskj.common.bean.model.UserAppeal;
import com.bskj.common.bean.model.UserCar;
import com.bskj.common.bean.model.UserInfo;
import com.bskj.common.service.IBaseService;
import com.bskj.kuaifu.bean.vo.req.UserReqVo;
import com.bskj.kuaifu.bean.vo.resp.UserMyMoneyDetailRespVo;

public interface IUserInfoService extends IBaseService<UserInfo> {
	/**
	 * 根据车牌号查找用户
	 * 
	 * @param carNo
	 *            车牌号码
	 * @return 用户信息
	 * @throws Exception
	 */
	UserInfo getUserInfoByCarNo(String appid, String carNo) throws Exception;

	/**
	 * 查找用户
	 * @param openid
	 * @return
	 * @throws Exception
	 */
	UserInfo getUserInfoByOpenId(String openid) throws Exception;

	/**
	 * 查找用户
	 * @param phone
	 * @return
	 * @throws Exception
	 */
	UserInfo getUserInfoByPhone(String phone) throws Exception;

	/**
	 * 查找用户
	 * @param openid
	 * @param appid
	 * @return
	 * @throws Exception
	 */
	UserInfo getUserInfoByUnionidId(String unionid) throws Exception;

	/**
	 * 更新用户以及车牌信息
	 * @return
	 * @throws Exception
	 */
	@Transactional
	Map<String, Object> updateUserAndCarInfo(String appid, String openid, String carNo,String unionid) throws Exception;

	/**
	 * 用户注册
	 * @param userReqVo
	 * @return
	 * @throws Exception
	 */
	@Deprecated
	@Transactional(rollbackFor = Exception.class)
	Map<String, String> register(UserReqVo userReqVo) throws Exception;

	/**
	 * 绑定车牌
	 * @param userReqVo
	 * @return
	 * @throws Exception
	 */

	@Transactional(rollbackFor = Exception.class)
	Map<String, Object> bindCarNo(String openid, String plateNumber) throws Exception;

	Map<String, Object> bindCarNoGZ(Integer userId, String plateNumber) throws Exception;
	
	UserMyMoneyDetailRespVo getMyMoneyDetail(Integer userId) throws Exception;

	/**
	 * 删除车牌
	 * @param userReqVo
	 * @return
	 * @throws Exception
	 */
	@Transactional(rollbackFor = Exception.class)
	Map<String, Object> delCarNo(String openid ,String plateNumber) throws Exception;

	/**
	 * 获取用户车牌
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	List<UserCar> getMyCarNo(Integer userId) throws Exception;

	/**
	 * 查找车牌绑定信息
	 * 
	 * @param carNo
	 * @return
	 * @throws Exception
	 */
	UserCar getCarNo(String appid, String carNo) throws Exception;

	/**
	 * 查询用户无感状态,并更新用户车牌信息
	 * 
	 * @param openid
	 * @return
	 * @throws Exception
	 */
	@Transactional(rollbackFor = Exception.class)
	Map<String, Object> queryUserNoSenseStatus(Integer userId, String openid, String plateNumber) throws Exception;
	
	
	
	/**
	 * 用户提现
	 * 
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	@Deprecated
	@Transactional(rollbackFor = Exception.class)
	Map<String, Object> withdrawCash(Integer userId) throws Exception;

	@Transactional(rollbackFor = Exception.class)
	public Map<String, String> refund(PayInfo payInfo) throws Exception;

	public void setRefundInfoDetail(PayInfo payInfo) throws Exception;

	/**
	 * 用户投诉的类型
	 * @return
	 */
	public List<CodeValue> findAppealType() throws Exception;

	public void insertAppeal(UserAppeal userAppeal) throws Exception;
}
